//package com.healthcloud.listener;
//
//import com.alibaba.fastjson.JSON;
//import com.healthcloud.pojo.TestResult;
//import com.rabbitmq.client.Channel;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
//import org.springframework.stereotype.Component;
//
///**
// *
// * poct类消费监听器
// * @Author yucl
// * @date 2018/7/30
// */
//@Component
//public class PoctListener implements  ChannelAwareMessageListener {
//
//    @RabbitListener(queues = "poctQueue")
//    @Override
//    public void onMessage(Message message, Channel channel) throws Exception {
//        try {
//            System.out.println("ACK");
//            System.out.println(new String(message.getBody()));
//            Object object = JSON.parse(new String(message.getBody()));
//            TestResult testResult = JSON.parseObject(object.toString(),TestResult.class);
//
//
//            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
//        }catch (Exception e){
//            e.printStackTrace();
//            System.out.println("NACK");
//            channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, true);
//        }
//    }
//}
